/**
 * <p>Project: asmpserver</p>
 * <p>Package: com.pactera.asmp.server.entity</p>
 * <p>File: MasterProjectDeviceVo.java</p>
 * <p>Date: 2021/4/15/10:35.</p>
 */
package com.pactera.asmp.server.entity;

import com.pactera.asmp.server.pojo.DeviceInfoWithProject;
import com.pactera.asmp.server.pojo.ProjectInfo4Device;

import java.util.List;

import lombok.Data;

/**
 * <p>Class: com.pactera.asmp.server.entity.MasterProjectDeviceVo</p>
 * <p>Description: </p>
 * <pre>
 *
 * </pre>
 *
 * @author Kevin.Lian
 * @date 2021/4/15/10:35
 */
@Data
public class MasterProjectDeviceVo implements Comparable<MasterProjectDeviceVo> {

    private ProjectInfo4Device projectInfo;
    private List<DeviceInfoWithProject> deviceInfos;

    @Override
    public int compareTo(MasterProjectDeviceVo o) {
        // 1. 项目绑定设备数据从多到少
        if(this.getProjectInfo().getDeviceBindCount().intValue() != o.getProjectInfo().getDeviceBindCount().intValue()){
            return o.getProjectInfo().getDeviceBindCount().intValue() - this.getProjectInfo().getDeviceBindCount().intValue();
        }
        return 0;
    }
}
